package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * @author 朱其鹏
 * @date 2024/4/11 09:43
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("wx_pay_configs")
public class WxPayConfigEntity {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商户号")
    private String mchId;
    
    @ApiModelProperty(value = "商户密钥")
    private String mchKey;
    
    @ApiModelProperty(value = "p12证书内容")
    private String p12Content;
    
    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;
    
    @ApiModelProperty(value = "租户 id")
    private Long tenantId;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic(value = "null", delval = "now()")
    @TableField(select = false)
    private LocalDateTime deletedAt;
    
    public WxPayConfigEntity() {
    }
    
    public WxPayConfigEntity(String mchId, String mchKey) {
        this.mchId = mchId;
        this.mchKey = mchKey;
    }
    
    public WxPayConfigEntity(String mchId, String mchKey, String p12Content) {
        this.mchId = mchId;
        this.mchKey = mchKey;
        this.p12Content = p12Content;
    }
    
    public WxPayConfigEntity(String mchId, String mchKey, String p12Content, Long cinemaId) {
        this.mchId = mchId;
        this.mchKey = mchKey;
        this.p12Content = p12Content;
        this.cinemaId = cinemaId;
    }
}